import useCustomerService from '@/components/useCustomerService';
import { Icon } from '@antmjs/vantui';
import { Text, View } from '@tarojs/components';
import { useState } from 'react';

export default function Tip() {
  const [show, setShow] = useState<boolean>(true);

  const { renderNode: renderCustomNode, open: openSercive } =
    useCustomerService();
  if (!show) return <></>;

  return (
    <>
      <View className='fixed z-10 left-0 top-0 right-0 flex items-center justify-center bg-[#F2F3FF] py-2 px-4 text-xs'>
        <Icon name='info' className=' text-primary mr-2' />
        如需修改个人主页信息，请联系
        <Text className=' font-bold text-primary' onClick={() => openSercive()}>
          平台客服
        </Text>
        <Icon
          name='cross'
          className=' text-gary4 text-lg ml-auto'
          onClick={() => setShow(false)}
        />
      </View>
      {renderCustomNode()}
    </>
  );
}
